package com.zf.yichat.service;

import com.zf.yichat.dto.GroupUserDto;
import com.zf.yichat.model.GroupAdmin;
import com.zf.yichat.model.RcGroupMembers;
import com.zf.yichat.model.RcGroups;
import com.zf.yichat.utils.response.FsPage;
import com.zf.yichat.utils.response.FsResponse;
import com.zf.yichat.vo.GroupRoleType;

import java.util.List;

/**
 * 一句话描述功能
 *
 * @author fengsong
 * @date create in 10:16 2019/6/18 2019
 */
public interface GroupService {

    FsResponse selectUserList(FsPage page, Long userId, Integer groupId);


    void updateRoleType(Long userId, Integer groupId, GroupRoleType roleType,Integer status);

    List<GroupUserDto> selectAdminList(Integer groupId);

    List<GroupUserDto> selectSilentList(Integer groupId);

    GroupAdmin selectAdmin(Long userId, Integer groupId);

    //设置群禁言  0设置群成员 1设置群禁
    void updateSilentStatus(Long userId, Integer groupId,Integer type,Integer status);

    boolean isAdmin(Integer groupId, Long userId);

    Long  getCreator(Integer groupId);

    RcGroups selectById(Integer id);

    GroupRoleType selectRoleType(Integer groupId, Long userId);

    List<RcGroupMembers> selectGroupByUserId(Long userId);

    RcGroupMembers selectGroupMember(Integer groupId, Long userId);

    Integer countMember(Integer groupId);

    Integer getGroupSilentStatus(Integer groupId);

    List<RcGroupMembers> selectGroupByIds(List<Integer> groupId, Long userId);

    List<RcGroups> selectMyGroupList(Long userId);

    List<RcGroups> selectMyOwnerList(Long userId);

    List<RcGroups> selectGroupListByCreater(Long userId);

    int selectProtectStatus(Integer groupId);

    void setProtectStatus(Long userId,Integer groupId,Integer status);

    RcGroups selectGroupsById(Long decodeGroupId);

    GroupAdmin selectAdminByGroupId(Long decodeGroupId);

    /**
     * 查询用户是否在群里
     * @param groupId
     * @param userId
     * @return
     */
    Integer checkMemberInGroup(Integer groupId, Long userId);

    /**
     * 后台群组移除成员操作
     * @param uid
     * @param gid
     */
    void memberQuit(Long uid, Integer gid) throws Exception;
}
